<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>后台人员列表 高级检索</title>
    <script src="/jquery/jquery-3.2.1.min.js"></script>
    <script src="/layui/layui.js"></script>
    <link rel="stylesheet" href="/layui/css/layui.css"/>
</head>
<body>
    <form class="layui-form">

        <div class="layui-form-item" style="margin-top: 30px">

            <label class="layui-form-label">用户邮箱:</label>
            <div class="layui-input-inline">
                <input type="text" name="email" placeholder="输入邮箱" class="layui-input">
            </div>

            <label class="layui-form-label">手机号:</label>
            <div class="layui-input-inline">
                <input type="text" name="phone" placeholder="输入手机号" class="layui-input">
            </div>

        </div>

        <div class="layui-form-item" style="margin-top: 30px">

            <label class="layui-form-label">身份证号:</label>
            <div class="layui-input-inline">
                <input type="text" name="idCard" placeholder="输入证件号码" class="layui-input">
            </div>

            <label class="layui-form-label">账户状态:</label>
            <div class="layui-input-inline">
                <select name="status" >
                    <option value=""></option>
                    <option>使用中</option>
                    <option>已注销</option>
                    <option>冻结中</option>
                    <option>已封停</option>
                </select>
            </div>

        </div>

        <div class="layui-form-item" style="margin-top: 30px">

            <label class="layui-form-label">性别:</label>
            <div class="layui-input-inline">
                <select name="sex" >
                    <option value=""></option>
                    <option>男</option>
                    <option>女</option>
                </select>
            </div>

            <label class="layui-form-label">是否启用:</label>
            <div class="layui-input-inline">
                <select name="enabled" >
                    <option value=""></option>
                    <option>yes</option>
                    <option>no</option>
                </select>
            </div>

        </div>

        <div style="float: right; margin-bottom: 10px;margin-right: 38px">
            <button type="button" lay-submit lay-filter="sub" class="layui-btn">确定</button>
            <button type="button" onclick="cancel()" class="layui-btn layui-btn-warm">取消</button>
        </div>

    </form>
</body>
<script>
    layui.use(['form','layer','jquery'],function(){
        var form = layui.form,
            layer = layui.layer,
            $ = layui.$;

        form.on('submit(sub)',function(obj){
            var data = obj.field;

            //获取状态
            if(data.status == ''){
                data.status = '';
            }else if(data.status == '使用中'){
                data.status = 1;
            }else if(data.status == '已注销'){
                data.status = 2;
            }else if(data.status == '冻结中'){
                data.status = 3;
            }else if(data.status == '已封停'){
                data.status = 4;
            }else{
                data.status = '';
            }

            //获取是否启用
            if(data.enabled == ''){
                data.enabled = '';
            }else if(data.enabled == 'yes'){
                data.enabled= 1;
            }else if(data.enabled == 'no'){
                data.enabled= 2;
            }else{
                data.enabled= '';
            }


            $.ajax({
                 url: '/jurisdiction/advancedRetrieval'
                ,data: data
                ,dataType: 'json'
                ,success:function(data){
                     parent.tableRender(data.data);
                    var layer = parent.layer;
                    layer.close(layer.index);
                }
            });
        });


        cancel = function cancel() {
            var layer = parent.layer;
            layer.close(layer.index);
        }

    });
</script>
</html>